package lyx.game
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	import lyx.game.control.KeyBoardController;
	
	[SWF(width=640,height=480)]
	public class GameFrameWork extends Sprite
	{
		public function GameFrameWork()
		{
			addChild(World.getInstance());
			addEventListener(Event.ADDED_TO_STAGE,addToStage);
		}
		
		protected function addToStage(event:Event):void
		{
			stage.frameRate = 30;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			KeyBoardController.getInstance().registerController(stage);
		}
	}
}